package com.caowei.weicimpress.weicimpress;

import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;

/**
 * Created by caoweiPc on 2014/7/15.
 */
public abstract class BaseActivity extends ActionBarActivity {
    private final static String TAG=BaseActivity.class.getSimpleName();
    protected int SCREEN_W;
    protected int SCREEN_H;
    protected float DENSITY;
    protected ActionBar bar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initactioBar();
        ActivityManager.getInstance().push(this);
        SCREEN_H=  getResources().getDisplayMetrics().heightPixels;
        SCREEN_W=  getResources().getDisplayMetrics().widthPixels;
        DENSITY=getResources().getDisplayMetrics().density;
        Log.d(TAG, "SCREEN_W=" + SCREEN_W + " SCREEN_H=" + SCREEN_H + " DENSITY=" + DENSITY);

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ActivityManager.getInstance().popTop(this);
    }

    protected abstract void initactioBar();


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return super.onCreateOptionsMenu(menu);
    }
}
